<?php
									$sql = "SELECT * from  v_product WHERE sta_id='$status'"; 
                                    $result = query($sql);
									$Num_Rows = mysql_num_rows($result);
							
									$Per_Page = 18;   // Per Page
									
									@$Page = $_GET["Page"];
									if(!@$Page)
									{
										$Page=1;
									}
									
									$Prev_Page = $Page-1;
									$Next_Page = $Page+1;
									
									$Page_Start = (($Per_Page*$Page)-$Per_Page);
									if($Num_Rows<=$Per_Page)
									{
										$Num_Pages =1;
									}
									else if(($Num_Rows % $Per_Page)==0)
									{
										$Num_Pages =($Num_Rows/$Per_Page) ;
									}
									else
									{
										$Num_Pages =($Num_Rows/$Per_Page)+1;
										$Num_Pages = (int)$Num_Pages;
									}
									
									$sql .=" ORDER BY pro_id DESC  LIMIT $Page_Start , $Per_Page";
									$result  = mysql_query($sql);
                                    while($row = fetch_assoc($result))
                                    {
                                ?>
                                <tr>
                                	<td align="center"><?php echo $row["pro_name"];?></td>
                                    <td align="center"><?php echo $row["cat_name"];?></td>
                                    <td align="center"><?php echo $row["price"]." €";?></td>
                                    <td align="center"><?php echo $row["status"];?> </td>
                                    <td align="center">
                                    	<?php 
                                            $icon_publish = $row["show_front"]==0 ? "publish_x.png" : "publish_y.png";
                                            $publish_image = "<img width='15px' src='images/{$icon_publish}' />";														
                                     ?>
                                            <a href="index.php?page=product&showFront=<?php echo $row["show_front"] . "&pro_id_showFront=" . $row["pro_id"];?>">
                                            <?php echo $publish_image; ?></a>
                                     </td>
                                    <td align="center">
									<?php 
                                            $icon_publish = $row["published"]==0 ? "publish_x.png" : "publish_y.png";
                                            $publish_image = "<img width='15px' src='images/{$icon_publish}' />";														
                                     ?>
                                            <a href="index.php?page=product&published=<?php echo $row["published"] . "&pro_id_pub=" . $row["pro_id"];?>">
                                            <?php echo $publish_image; ?></a>
                                   </td>
                                    <td align="center">
              
                                   <a href="index.php?page=productEdit&pro_id=<?php echo $row["pro_id"]?>"><img class="action_distant" src="images/edit.png"  /></a>
                                   <a href="index.php?page=product&pro_id[<?php echo $row["pro_id"];?>]=<?php echo $row["photo"];?>" onclick="return confirm('Êtes-vous sûr de vouloir supprimer cette product.php? Tous les galeris va supprimer tous ..!');"><img class="action_distant" src="images/delete.png" /></a>
                                   <a href="index.php?page=galleryNew&pro_id=<?php echo $row["pro_id"];?>&pro_name=<?php echo $row["pro_name"];?>"><img class="action_distant" src="images/photo.png" /></a>
                                    </td>
                                </tr>
                                <?php
									}//end while

                                ?>
                            </table>
                         <!--end table -->
                    			<?php
								echo "<div id='Paginator_left'> Total $Num_Rows Record ";
								
                                
                                    $pages = new Paginator;
                                    $pages->items_total = $Num_Rows;
                                    $pages->mid_range = 18;
                                    $pages->current_page = $Page;
                                    $pages->default_ipp = $Per_Page;
                                    $pages->url_next ="index.php?page=product&cbostatus=$status&QueryString=value&Page=";
                                    $pages->paginate();
                                    
                                    echo $pages->display_pages();
									
									
                               echo " </div>" ;
?>